package com.gao.service.impl;

import com.gao.dao.UsersMapper;
import com.gao.domain.Users;
import com.gao.service.IUsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author gao
 * @time 2020/05/29 17:22:53
 */
@Service
public class UserServiceImpl implements IUsersService {
    @Autowired
    private UsersMapper mapper;

    @Override
    public void save(Users users) {
        mapper.insertSelective(users);
    }

    @Override
    public Users find(Integer uid) {
        Users users = mapper.selectByPrimaryKey(uid);
        return users;
    }

    @Override
    public List<Users> find() {
        return mapper.selectByExample(null);
    }
}
